home *** CD-ROM | disk | FTP | other *** search
/ Our Birds: Texas / eViewer 3.9.iso / Thayer eField Guide Viewer v3.9.msi / Binary.NewBinary20 < prev    next >
Encoding:
Text File  |  2007-10-03  |  968 b   |  30 lines

  1. Function CorrectConfigFile()
  2.     On Error Resume Next
  3.  
  4.     configFileName = Session.Property("CustomActionData")
  5.  
  6.     Set doc = CreateObject("Msxml2.DOMDocument.4.0")
  7.     If Err.Number <> 0 Then
  8.         MsgBox "Could not create XML Document object."        
  9.         Exit Function
  10.     End If
  11.  
  12.     doc.Load configFileName
  13.     Set configurationNode = doc.SelectSingleNode("/configuration")
  14.  
  15.     ' Check to make sure that configSections is the first child node of configuration
  16.     Set firstNode = configurationNode.FirstChild
  17.     If firstNode.Text <> "configSections" Then
  18.         ' If not, move the configSectionsNode to the beginning.
  19.         Set configSectionsNode = configurationNode.SelectSingleNode("configSections")
  20.         configurationNode.RemoveChild configSectionsNode
  21.         configurationNode.InsertBefore configSectionsNode, configurationNode.FirstChild
  22.  
  23.         doc.Save configFileName
  24.     End If
  25.     
  26.     If Err.Number <> 0 Then
  27.         MsgBox "Error # " & CStr(Err.Number) & " " & Err.Description
  28.     End If
  29. End Function
  30.